#ifndef SESSIONSMANAGER_H
#define SESSIONSMANAGER_H

#include <QtGui/QDialog>
#include "AdvancedEditor.h"

class ListWidget;
class QPushButton;
class QMessageBox;

class SessionsManager : public QDialog
{
	Q_OBJECT
	signals:
		void currentSessionChanged(const QString& sessionName);
	public slots:
		void saveSessionAs(const QString& name);
		void openSession(const QString& name);
		void removeSession(const QString& name);
	public:
		SessionsManager(AdvancedEditor *advancedEditor,QWidget *parent = 0);
		~SessionsManager();
		
		const QString& getCurrentSessionName() const { return currentSessionName; }
		
		void saveSettings();
	private slots:
		void startNewSession();
	private:
		AdvancedEditor *advancedEditor;
		
		ListWidget *listWidget;
		QString currentSessionName;
		QString pathToSessions;
		
		QMessageBox *removeSessionDialog;
		QPushButton *removeButtonDialog;
		QPushButton *cancelButtonDialog;
		
		void saveCurrentSession();
};

#endif
